package com.qmerak.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.qmerak.dao.impl.UnitDao;
import com.qmerak.entity.OrgEntity;
import com.qmerak.entity.PostUnitEntity;
import com.qmerak.service.IPostUnitService;

/**
 * @author Shaohong•Cheng
 * @mail shaohong726@126.com
 * @date 2013-5-19
 * @project WebTest
 */
@Service
public class PostUnitServiceImpl implements IPostUnitService {
	@Autowired
	private UnitDao unitDao;

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.service.IPostUnitService#add(com.entity.PostUnitEntity)
	 */
	@Override
	public PostUnitEntity add(PostUnitEntity entity) {
		return unitDao.add(entity);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.service.IPostUnitService#delete(com.entity.PostUnitEntity)
	 */
	@Override
	public void delete(PostUnitEntity entity) {
		unitDao.remove(entity);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.service.IPostUnitService#update(com.entity.PostUnitEntity)
	 */
	@Override
	public void update(PostUnitEntity entity) {
		unitDao.update(entity);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.service.IPostUnitService#list()
	 */
	@Override
	public List<PostUnitEntity> list() {
		return unitDao.list();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.service.IPostUnitService#unitsOfOrg(com.entity.OrgEntity)
	 */
	@Override
	public List<PostUnitEntity> unitsOfOrg(OrgEntity orgEntity) {
		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.qmerak.service.IPostUnitService#find(java.lang.String)
	 */
	@Override
	public PostUnitEntity find(String id) {
		return unitDao.find(id);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.qmerak.service.IPostUnitService#queryByCondition(java.lang.String)
	 */
	@Override
	public List<PostUnitEntity> queryByCondition(String condition) {
		return unitDao.queryByCondition(condition);
	}

}
